home *** CD-ROM | disk | FTP | other *** search
- /* getlinesettings */
-
- #include <stdio.h>
- #include <graphics.h>
- /* Define the pattern names */
-
- char *patname[]=
- {"Solid","Dotted","Centered","Dashed","User defined patter"};
-
- main()
- {
- int graphdriver = DETECT,graphmode;
- struct linesettingstype lsettings;
- char buffer[80];
-
- /* Initialize the graphics system */
-
- initgraph(&graphdriver,&graphmode,"c:\\turboc");
- outtextxy(10,20,"Demonstrating getlinesettings");
-
- /* Get current line settings and dscribe them */
-
- getlinesettings(&lsettings);
- sprintf(buffer,
- "Line style is %s, %d pixels wide",
- patname[lsettings.linestyle],
- lsettings.thickness);
- outtextxy(10,60,buffer);
- sprintf(buffer,"Current line pattern is: %x",
- lsettings.upattern);
- outtextxy(10,70,buffer);
- outtextxy(10,90,"Here's how it looks");
- line(10,100,210,100);
- /* Give user a chance to see the result */
- outtextxy(10,220,"Hit any key to exit:");
- getch();
- closegraph();
- }